from django.contrib import admin

# Register your models here.
from django.contrib import admin

from BookApp.models import BookInfo
from BookApp.models import BookCharacter


class BookInfoAdmin(admin.ModelAdmin):
    """书籍信息管理类"""
    list_display = ("id", "title", "auhtor", "year")


class BookCharacterAdmin(admin.ModelAdmin):
    """人物信息管理类"""
    list_display = ("id", "name", "power", "gender", "foreignKey")


# 向后台管理注册管理类
admin.site.register(BookInfo, BookInfoAdmin)
admin.site.register(BookCharacter, BookCharacterAdmin)


# 创建后台管理账户:
# python3 manage.py createsuperuser
# admin / admin12345
# 去终端执行 : python3 manage.py runserver  (后台管理地址为:http://127.0.0.1:8000/admin/)